import config from "@/config"
import http from "@/utils/request"

export default {
	ver: {
		url: `${config.API_URL}/mock/ver`,
		name: "获取最新版本号",
		get: async function(params){
			return await http.get(this.url, params);
		}
	},
	post: {
		url: `${config.API_URL}/mock/post`,
		name: "分页列表",
		post: async function(data){
			return await http.post(this.url, data, {
				headers: {
					//'response-status': 401
				}
			});
		}
	},
	page: {
		url: `${config.API_URL}/mock/page`,
		name: "分页列表",
		get: async function(){
			return {
				"code": 200,
				"data": {
				  "total": 41,
				  "rows": [
					{
					  "id": "410000199512025445",
					  "name": "用户登录",
					  "url": "/oauth/token",
					  "type": "GET",
					  "code": "401",
					  "cip": "95.214.92.71",
					  "user": "魏磊",
					  "time": "2012-09-05 18:08:06"
					},
					{
					  "id": "520000198407304275",
					  "name": "用户登录",
					  "url": "/oauth/token",
					  "type": "GET",
					  "code": "500",
					  "cip": "129.166.168.115",
					  "user": "史平",
					  "time": "1993-08-25 05:08:41"
					},
					{
					  "id": "230000199511014097",
					  "name": "用户登录",
					  "url": "/oauth/token",
					  "type": "GET",
					  "code": "200",
					  "cip": "186.160.119.210",
					  "user": "于杰",
					  "time": "1998-02-09 13:42:41"
					},
					{
					  "id": "990000197205236780",
					  "name": "用户登录",
					  "url": "/oauth/token",
					  "type": "POST",
					  "code": "401",
					  "cip": "193.14.94.222",
					  "user": "田娟",
					  "time": "2009-11-05 12:37:58"
					},
					{
					  "id": "640000200911201176",
					  "name": "用户登录",
					  "url": "/oauth/token",
					  "type": "GET",
					  "code": "500",
					  "cip": "12.69.226.121",
					  "user": "邵涛",
					  "time": "1989-08-25 05:33:06"
					},
					{
					  "id": "710000198709077149",
					  "name": "用户登录",
					  "url": "/oauth/token",
					  "type": "GET",
					  "code": "500",
					  "cip": "116.42.15.149",
					  "user": "魏娟",
					  "time": "2008-09-07 10:35:41"
					},
					{
					  "id": "360000197302144442",
					  "name": "用户登录",
					  "url": "/oauth/token",
					  "type": "GET",
					  "code": "500",
					  "cip": "239.114.89.252",
					  "user": "何敏",
					  "time": "2016-07-14 20:41:53"
					},
					{
					  "id": "500000199407048831",
					  "name": "用户登录",
					  "url": "/oauth/token",
					  "type": "GET",
					  "code": "401",
					  "cip": "95.203.182.52",
					  "user": "傅刚",
					  "time": "1995-03-09 23:53:50"
					},
					{
					  "id": "450000198307033289",
					  "name": "用户登录",
					  "url": "/oauth/token",
					  "type": "GET",
					  "code": "500",
					  "cip": "60.137.195.112",
					  "user": "康伟",
					  "time": "1970-01-13 19:18:19"
					},
					{
					  "id": "220000200908305857",
					  "name": "用户登录",
					  "url": "/oauth/token",
					  "type": "POST",
					  "code": "500",
					  "cip": "106.167.1.227",
					  "user": "何秀英",
					  "time": "1976-01-01 14:27:22"
					},
					{
					  "id": "450000201411302578",
					  "name": "用户登录",
					  "url": "/oauth/token",
					  "type": "GET",
					  "code": "401",
					  "cip": "241.235.41.98",
					  "user": "吴涛",
					  "time": "2003-10-22 18:03:07"
					},
					{
					  "id": "81000020100227047X",
					  "name": "用户登录",
					  "url": "/oauth/token",
					  "type": "GET",
					  "code": "200",
					  "cip": "120.218.167.233",
					  "user": "毛军",
					  "time": "1983-12-27 22:13:35"
					},
					{
					  "id": "420000198411242296",
					  "name": "用户登录",
					  "url": "/oauth/token",
					  "type": "GET",
					  "code": "500",
					  "cip": "123.130.209.70",
					  "user": "张霞",
					  "time": "2008-06-17 01:36:50"
					},
					{
					  "id": "460000201605269026",
					  "name": "用户登录",
					  "url": "/oauth/token",
					  "type": "POST",
					  "code": "500",
					  "cip": "79.243.107.181",
					  "user": "段超",
					  "time": "1980-01-16 19:59:55"
					},
					{
					  "id": "610000200506056280",
					  "name": "用户登录",
					  "url": "/oauth/token",
					  "type": "POST",
					  "code": "200",
					  "cip": "14.23.92.219",
					  "user": "宋涛",
					  "time": "1986-10-19 11:28:05"
					},
					{
					  "id": "370000197405268159",
					  "name": "用户登录",
					  "url": "/oauth/token",
					  "type": "POST",
					  "code": "500",
					  "cip": "233.81.94.91",
					  "user": "石勇",
					  "time": "2012-04-29 21:58:34"
					},
					{
					  "id": "440000200407105727",
					  "name": "用户登录",
					  "url": "/oauth/token",
					  "type": "POST",
					  "code": "200",
					  "cip": "178.29.69.222",
					  "user": "贾超",
					  "time": "1989-09-28 16:26:08"
					},
					{
					  "id": "45000019760731722X",
					  "name": "用户登录",
					  "url": "/oauth/token",
					  "type": "GET",
					  "code": "500",
					  "cip": "117.35.28.120",
					  "user": "汤强",
					  "time": "1975-05-24 14:29:46"
					}
				  ]
				},
				"message": ""
			  };
			//return await http.get(this.url, params);
		}
	},
	list: {
		url: `${config.API_URL}/mock/list`,
		name: "数据列表",
		get: async function(){
			return {
				"code": 200,
				"data": {
				  "total": 5,
				  "page": 1,
				  "pageSize": 20,
				  "summary": {
					"num": "999.00",
					"progress": "888.00"
				  },
				  "rows": [
					{
					  "id": "500000199701276667",
					  "name": "Larry Thomas",
					  "email": "a.tesnususn@baeox.中国互联.网络",
					  "ip": "218.55.201.155",
					  "datetime": "2009-11-15 05:14:12",
					  "boolean": true,
					  "type": "1",
					  "sex": "男",
					  "progress": 5,
					  "num": 91
					},
					{
					  "id": "450000199005177214",
					  "name": "Margaret Miller",
					  "email": "e.fcitfz@flklbjdem.zm",
					  "ip": "34.71.224.117",
					  "datetime": "1988-10-12 01:40:39",
					  "boolean": true,
					  "type": "1",
					  "sex": "女",
					  "progress": 22,
					  "num": 226
					},
					{
					  "id": "53000019971022352X",
					  "name": "Edward White",
					  "email": "j.bfosduwuh@movzx.name",
					  "ip": "20.249.221.244",
					  "datetime": "1980-10-16 02:48:56",
					  "boolean": false,
					  "type": "0",
					  "sex": "男",
					  "progress": 13,
					  "num": 392
					},
					{
					  "id": "510000201602072417",
					  "name": "Maria Moore",
					  "email": "d.ftynvl@zmzir.co",
					  "ip": "47.205.121.204",
					  "datetime": "2001-01-23 20:51:25",
					  "boolean": true,
					  "type": "0",
					  "sex": "女",
					  "progress": 41,
					  "num": 877
					},
					{
					  "id": "150000197302184381",
					  "name": "Scott Jones",
					  "email": "g.cruw@fdoq.gy",
					  "ip": "29.109.187.210",
					  "datetime": "2013-08-17 17:03:18",
					  "boolean": true,
					  "type": "1",
					  "sex": "女",
					  "progress": 86,
					  "num": 821
					}
				  ]
				},
				"message": ""
			  };
			//return await http.get(this.url, params);
		}
	},
	menu: {
		url: `${config.API_URL}/mock/menu`,
		name: "普通用户菜单",
		get: async function(){
			return await http.get(this.url);
		}
	},
	status: {
		url: `${config.API_URL}/mock/status`,
		name: "模拟无权限",
		get: async function(code){
			return await http.get(this.url, {}, {
				headers: {
					"response-status": code
				}
			});
		}
	}
}
